#ifndef MAINWINDOW_H
#define MAINWINDOW_H

#include <QtGui/QMainWindow>
#include <QtGui/QSystemTrayIcon>
#include <QtGui/QMenu>
#include <QtGui/QImage>
#include <QtGui/QPainter>
#include <QtCore/QTime>
#include <QtCore/QMutex>
#include <QtCore/QTimer>
#include "vkclient.h"
#include "options.h"
#include "aboutdialog.h"


namespace Ui
{
    class MainWindowClass;
}

class MainWindow : public QMainWindow
{
    Q_OBJECT

public:
    MainWindow(QString email, QString pass, QWidget *parent = 0);
    ~MainWindow();
    Ui::MainWindowClass *ui;
    void createActions();
    void setIcon(QString fileName);
    void createTrayIcon();
    bool stopSleep;
    //bool needExit;
    void msleep(unsigned long msecs);
    void showNotifier();

private:
    QString imageDir;
    QSystemTrayIcon *trayIcon;
    QMenu *trayIconMenu;
    QAction *optionsAction;
    QAction *aboutAction;
    QAction *quitAction;
    QString standartIcon;
    VKChecker *checker;
    QString lastQ;
    QTimer *mainTimer;
    int renotifyCount;
    bool notifierShowed;
    bool running;
    //void start();
    void check(bool forceToolTip);
    //bool optionsWindowActive;
    Options *options;
    aboutDialog *aboutWindow;

private slots:
    void iconActivated(QSystemTrayIcon::ActivationReason reason);
    void showOptions();
    void showAbout();
    void quit();
    void onTimer();

//    void on_pushButton_clicked();
//    void on_backgroundLabel_clicked();
};

#endif // MAINWINDOW_H
